package com.qf.test;

import com.qf.factory.BeanFactory;
import com.qf.pojo.User;
import com.qf.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    @Test
    public void UserById() throws Exception {
//        BeanFactory beanFactory=new BeanFactory("/bean.properties");

//        UserService userService = (UserService)beanFactory.getBean("userService");

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserService userService = (UserService) applicationContext.getBean("userService");
        User userById = userService.findUserById(11);
        System.out.println(userById);
    }
}
